package com.googlecode.gmf.io;


class MindFieldReaderTest extends GroovyTestCase {

	void testXmlFileIsRead() {
		def reader = new MindFieldReader()
		def input = new File("data/test-mind-field.xml")
		def web = reader.readMindField(input)
		assert web != null
		assertEquals 2, web.size()
	}

	void testXmlContentIsCorrectlyRead() {
		def reader = new MindFieldReader()
		def web = reader.readMindField(new File("data/test-mind-field.xml"))
		def node = web.findByTitle("Goya")
		assertNotNull "Goya node is null", node
		assertEquals "A Spanish artist", node.content
		
		node = web.findByTitle("Disasters of War")
		assertNotNull "DoW node is null", node
		assertEquals "Disasters of War", node.title
		assertEquals "A series of engravings created by Goya and published after his death.", node.content
	}
}
